package com.yidushishizijie;

/*
* 使用Lambda表达式
* 口诀：拷贝小括号，写死右箭头，落地大括号
* */
public class LambdaExpressDemo {
    public static void main(String[] args) {
       Foo foo = (x,y) -> {
           System.out.println("********HelloWorld");
           return x+y;
       };
       foo.add(1,2);
       foo.div(1,4);
       Foo.mv(1,3);
    }
}

@FunctionalInterface
interface Foo{
    public int add(int x,int y);

    default int div(int x,int y){
        System.out.println("*********hello world");
        return x*y;
    }

    public static int mv(int x,int y){
        System.out.println("*************Hello myFriend");
        return x;
    }
}
